/*
 *  Open BEAGLE
 *  Copyright (C) 2001-2007 by Christian Gagne and Marc Parizeau
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *  Contact:
 *  Laboratoire de Vision et Systemes Numeriques
 *  Departement de genie electrique et de genie informatique
 *  Universite Laval, Quebec, Canada, G1K 7P4
 *  http://vision.gel.ulaval.ca
 *
 */

/*!
 *  \file   beagle/Distrib/Master/MilestoneWriteOp.hpp
 *  \brief  Definition of class MilestoneWriteOp.
 *  \author Christian Gagne <cgagne@gmail.com>
 *  \author Marc Dubreuil <mdubreuil@gmail.com>
 *  $Revision: 1.5 $
 *  $Date: 2007/09/24 20:33:01 $
 */

#ifndef Beagle_Distrib_Master_MilestoneWriteOp_hpp
#define Beagle_Distrib_Master_MilestoneWriteOp_hpp

#include "beagle/config.hpp"
#include "beagle/macros.hpp"
#include "beagle/Object.hpp"
#include "beagle/AllocatorT.hpp"
#include "beagle/PointerT.hpp"
#include "beagle/ContainerT.hpp"
#include "beagle/MilestoneWriteOp.hpp"


namespace Beagle
{
namespace Distrib
{
namespace Master
{

/*!
 *  \class MilestoneWriteOp beagle/Distrib/MilestoneWriteOp.hpp "beagle/Distrib/MilestoneWriteOp.hpp"
 *  \brief Operator of that write a milestone.
 *  \ingroup DBMS
 */
class MilestoneWriteOp : public Beagle::MilestoneWriteOp
{

public:

	//! MilestoneWriteOp allocator type
	typedef Beagle::AllocatorT<MilestoneWriteOp,Beagle::MilestoneWriteOp::Alloc>
	Alloc;
	//! MilestoneWriteOp handle type.
	typedef Beagle::PointerT<MilestoneWriteOp,Beagle::MilestoneWriteOp::Handle>
	Handle;
	//! MilestoneWriteOp bag type.
	typedef Beagle::ContainerT<MilestoneWriteOp,Beagle::MilestoneWriteOp::Bag>
	Bag;

	explicit MilestoneWriteOp(std::string inName="DBMS-MilestoneWriteOp",
	                          std::string inDefaultAppName="dbeagle-app");
	virtual ~MilestoneWriteOp()
	{ }

	virtual void registerParams(Beagle::System& ioSystem);
	virtual void writeMilestone(std::string inFilename, Beagle::Context& ioContext);

protected:

	std::string             mDefaultAppName;   //!< Default application's name.
	Beagle::String::Handle  mAppName;          //!< Handle to the application's name.
	Beagle::String::Handle  mServerIP;         //!< Handle to the DAGS server's IP address
	Beagle::UInt::Handle    mServerPort;       //!< Handle to the DAGS server's port number
	Beagle::UInt::Handle    mCompressionLevel; //!< Handle to the to compression level used for send/receive messages

#ifdef BEAGLE_HAVE_LIBZ
	Beagle::Bool::Handle    mCompressMilestone; //!< True: compress file, false: keep as clear text.
#endif // BEAGLE_HAVE_LIBZ

};

}
}
}


#endif // Beagle_Distrib_Master_MilestoneWriteOp_hpp
